package ch8.Swim;

public class SubmarineTest {
    public static void main(String[] args) {
        Swim f=new Fish("鲨鱼","黑色");
        Swim s1=new Submarine("蛟龙号",100000);
        Swim s2=new Submarine("恶龙号",110000);
        System.out.println(f.toString());
        f.swim();
        System.out.println(s1.toString());
        s1.swim();
        System.out.println(s2.toString());
        s2.swim();
        ((Submarine) s1).scan(f);
        ((Submarine) s1).scan(s2);
    }
}
